inspector: Stop using ::size-allocate
authorMatthias Clasen <mclasen@redhat.com>
Tue, 5 May 2020 15:57:49 +0000 (11:57 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 6 May 2020 18:27:45 +0000 (14:27 -0400)
This signal is going away. Currently, there is no
other way for the inspector to monitor the allocation.

gtk/inspector/misc-info.c

index 659960d7b8020c5a6b10e009bc160796d72ea8a5..78108549410f8a7edf673a66a220fbab5d7c71e2 100644 (file)
@@ -139,11 +139,8 @@ state_flags_changed (GtkWidget *w, GtkStateFlags old_flags, GtkInspectorMiscInfo
 }
 
 static void
-allocation_changed (GtkWidget    *w,
-                    int           width,
-                    int           height,
-                    int           baseline,
-                    GtkInspectorMiscInfo *sl)
+update_allocation (GtkWidget            *w,
+                   GtkInspectorMiscInfo *sl)
 {
   GtkAllocation alloc;
   gchar *size_label;
@@ -419,7 +416,6 @@ gtk_inspector_misc_info_set_object (GtkInspectorMiscInfo *sl,
   if (sl->priv->object)
     {
       g_signal_handlers_disconnect_by_func (sl->priv->object, state_flags_changed, sl);
-      g_signal_handlers_disconnect_by_func (sl->priv->object, allocation_changed, sl);
       disconnect_each_other (sl->priv->object, G_OBJECT (sl));
       disconnect_each_other (sl, sl->priv->object);
       sl->priv->object = NULL;
@@ -452,8 +448,7 @@ gtk_inspector_misc_info_set_object (GtkInspectorMiscInfo *sl,
       g_signal_connect_object (object, "state-flags-changed", G_CALLBACK (state_flags_changed), sl, 0);
       state_flags_changed (GTK_WIDGET (sl->priv->object), 0, sl);
 
-      g_signal_connect_object (object, "size-allocate", G_CALLBACK (allocation_changed), sl, 0);
-      allocation_changed (GTK_WIDGET (sl->priv->object), 0, 0, -1, sl);
+      update_allocation (GTK_WIDGET (sl->priv->object), sl);
     }
   else
     {